home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Amos / AMOSList-0497 / AMOSLIST / 000133_amos-request@svcs1.digex.net_Wed Apr 16 08:11:03 1997.msg < prev    next >
Text File  |  1998-06-24  |  3KB  |  63 lines

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  2.     by mail1.access.digex.net (8.8.5/8.8.5) with ESMTP id IAA14100
  3.     for <mcox@access.digex.net>; Wed, 16 Apr 1997 08:11:02 -0400 (EDT)
  4. Received: (from daemon@localhost)
  5.     by svcs1.digex.net (8.8.5/8.8.5) id GAA21726
  6.     for amos-out; Wed, 16 Apr 1997 06:19:29 -0400 (EDT)
  7. Received: from mail1.access.digex.net (mail1.access.digex.net [205.197.247.2])
  8.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id GAA21723
  9.     for <amos-list@svcs1.digex.net>; Wed, 16 Apr 1997 06:19:28 -0400 (EDT)
  10. Received: from amalthea.salford.ac.uk (amalthea.salford.ac.uk [146.87.255.61])
  11.     by mail1.access.digex.net (8.8.5/8.8.5) with ESMTP id GAA26782
  12.     for <amos-list@access.digex.net>; Wed, 16 Apr 1997 06:19:15 -0400 (EDT)
  13. Received: from cms-notes-a.salford.ac.uk (actually host cms-notes-a.cms.salford.ac.uk) 
  14.           by amalthea.salford.ac.uk with SMTP (PP);
  15.           Wed, 16 Apr 1997 11:18:35 +0100
  16. Received: by cms-notes-a.salford.ac.uk(Lotus SMTP MTA v1.06 (346.4 3-18-1997))  
  17.           id 8025647B.003894B8 ; Wed, 16 Apr 1997 11:18:00 +0100
  18. X-Lotus-FromDomain: UNIVERSITY OF SALFORD
  19. From: Lee S Howarth <L.S.Howarth@cms.salford.ac.uk>
  20. To: amos-list@access.digex.net
  21. Message-ID: <8025647B.003751B3.00@cms-notes-a.salford.ac.uk>
  22. Date: Wed, 16 Apr 1997 11:12:58 +0100
  23. Subject: Re:Line Problems
  24. Mime-Version: 1.0
  25. Content-type: text/plain; charset=us-ascii
  26. Status: O
  27. X-Status: 
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. Reply to Mush...
  35.  
  36. I think I know what you are trying to do in your box-line thing so I will
  37. try and explain two methods I know...
  38. To get the Y position of the slope as you go from one point to another can
  39. be solved by using either a linedraw routine or calculating the difference
  40. of Y position on the slope and adding it (negative gradients as well) to
  41. the current Y position...
  42.  
  43. The first method can be done by using a Bresnham (i think thats how you
  44. spell it ;-) line draw, this basically is a line draw routine that uses
  45. only integer numbers... you give the line routine the start and end (the
  46. top and bottom of you box) and for every increment in the x position, you
  47. will be able to get the y position, and becoz the box can probably be
  48. reflected horizontally you can just use -ypos+screenheight to get the
  49. bottom of the box Y co-ord.
  50.  
  51. The second method means getting the gradient of the slope and doing a loop
  52. from the start X to the end X of the box and for every point inbetween,
  53. increment the y position by the difference in heght between each pixel,
  54. this does mean using floating point numbers thought so it`s VERY slow, but
  55. then again, so was the first method(slow I mean...) but at least they work
  56. :-)
  57.  
  58. I will try and post the bresenham linedraw routine... I use it for
  59. raycasting at the moment(that will soon change though)
  60.  
  61. Lee Howarth
  62.  
  63.